package com.sparkseries.common.util.redis;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;

public class RedisKeys {
    // 生成 Redis 缓存键

    public static String getSysNoticeKey(Long id) {
        return "sys:notice:" + id;
    }

    public static String getSysNoticeKey() {
        return "sys:notice";
    }

    public static String getSysNoticeListKey(Object o) {
        String listKey;
        if (ObjectUtils.isNull(o)) {
            listKey = "sys:notice:list:" + null;
        } else {
            listKey = "sys:notice:list:" + o.hashCode();
        }
        return listKey;
    }

    public static String getMyNoticeKey(){
        return "sys:myNotice";
    }

    public static String getLogKey(){
        return "sys:log";
    }
}
